﻿<!DOCTYPE html>
<html lang="zh-cn" data-name="泰信汽车服务" data-qqkey="EOLBZ-KKM3F-I5MJS-NXFBH-ACSQ5-WQFOX"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>泰信检车预约</title>
    <meta name="format-detection" content="telephone=no, address=no">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-touch-fullscreen" content="yes"/>
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <link rel="shortcut icon" href="/static/copy/picture/atxx1bundbvtx1vbdvtbbtb2zvcbbb.jpg"/>
    <link rel="stylesheet" href="/static/copy/css/weui.css"/>
    <link rel="stylesheet" href="/static/copy/css/weui.min.css">
    <link rel="stylesheet" href="/static/copy/css/dayu.css"/>
    <script type="text/javascript" src="/static/copy/js/font_847198_ex5ae4gllv9.js"></script>
    <script src="/static/copy/js/jquery-weui.min.js"></script>
    <script type="text/javascript" src="/static/copy/js/jweixin-1.4.0.js"></script>
    <script type="text/javascript" src="/static/copy/js/picker.js"></script>
    <script type="text/javascript" src="/static/copy/js/select.js"></script>
    <script type="text/javascript">
        if (navigator.appName == 'Microsoft Internet Explorer') {
            if (navigator.userAgent.indexOf("MSIE 5.0") > 0 || navigator.userAgent.indexOf("MSIE 6.0") > 0 || navigator.userAgent.indexOf("MSIE 7.0") > 0) {
                alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
            }
        }
        window.sysinfo = {
            'uniacid': '17',
            'acid': '17',
            'siteroot': 'http://888.huipin.co/',
            'siteurl': 'http://888.huipin.co/app/index.php?i=17&c=entry&id=1&do=dayu_yuyuepay&m=dayu_yuyuepay',
            'attachurl': 'http://888.huipin.co/attachment/',
            'attachurl_local': 'http://888.huipin.co/attachment/',
            'MODULE_URL': 'http://888.huipin.co/addons/dayu_yuyuepay/',
            'cookie': {'pre': '03ad_'}
        };

        // jssdk config 对象
        jssdkconfig = null || {};

        // 是否启用调试
        jssdkconfig.debug = false;

        jssdkconfig.jsApiList = [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onRecordEnd',
            'playVoice',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard'
        ];

    </script>
    <script type="text/javascript">
        function _removeHTMLTag(str) {
            if (typeof str == 'string') {
                str = str.replace(/<script[^>]*?>[\s\S]*?<\/script>/g, '');
                str = str.replace(/<style[^>]*?>[\s\S]*?<\/style>/g, '');
                str = str.replace(/<\/?[^>]*>/g, '');
                str = str.replace(/\s+/g, '');
                str = str.replace(/&nbsp;/ig, '');
            }
            return str;
        }
    </script>
</head>
<body id="message" ontouchstart>
<div class="weui_tab" id="tab">
    <script type="text/javascript" src="/static/copy/js/check.js"></script>
    <script src="/static/copy/js/iscroll.js"></script>

    <style>
        body {
            background-color: #fbf9ff;
        }

        .open-popup {
            cursor: pointer
        }

        .dayu-header {
            padding: 25px 0 0;
        }

        .placeholder {
            background-color: transparent;
            text-align: left;
            color: #333;
            height: 30px;
            line-height: 40px;
        }

        .weui_cell_bd .dayu-badge {
            margin-left: 10px;
        }

        .weui-flex-item {
            position: relative;
        }

        .weui_textarea_counter span {
            font-size: 12px;
        }

        .weui_label {
            font-size: 13px;
        }

        .weui_label span, .weui_cell_hd span {
            color: #E64340;
        }

        .weui_input, .weui_select {
            font-weight: 300;
            padding-left: 15px;
        }

        .weui-popup-container {
            z-index: 9;
        }

        .weui_cell_select .weui_cell_td {
            padding-left: 1em;
        }

        .weui_cell_select .weui_cell_hd .weui_select {
            line-height: 45px;
            padding: 0 25px 0 5px;
            color: #555;
        }

        .weui_msg .weui_extra_area {
            margin-bottom: 5px;
        }

        .weui_extra_area {
            z-index: 0;
        }

        .record .weui_cells:first-child {
            margin-top: 30px;
        }

        .record .weui_cells {
            margin: 0;
        }

        .record img {
            width: 1.2rem;
            height: 1.2rem;
        }

        .weui_cells_form .weui_cell_ft {
            font-size: 12px;
        }

        .m-img {
            background-position: top center;
        }

        .m-img img {
            width: 100%;
            height: auto;
        }

        .m-masker {
            background-color: rgba(0, 0, 0, 0);
        }

        .weui_tab_bd {
            padding-bottom: 15px;
        }

        .weui_select {
            z-index: 0;
        }

        .weui_grid {
            width: 50%;
            padding: 10px 10px;
        }

        .weui_grid:after {
            height: 0px;
            border-bottom: 0;
        }

        .weui-weixin .weui-weixin-content p {
            line-height: 150%;
        }

        .weui-navigator {
            background: #fff;
            position: relative;
            padding: 0;
            margin: 0
        }

        .weui-navigator-list {
            width: 100%;
            list-style: none;
            display: -webkit-box;
            margin: 0 auto
        }

        .weui-navigator-list li {
            padding: 0;
            list-style: none;
            line-height: 34px;
            font-size: 16px;
            font-weight: normal;
            text-align: center;
            -webkit-box-flex: 1;
            display: -webkit-box;
            white-space: nowrap;
            -webkit-box-align: center;
            -webkit-box-pack: center
        }

        .weui-navigator.weui-navigator-wrapper {
            z-index: 1;
            width: 100%;
            overflow: hidden;
            position: relative;
            -webkit-backface-visibility: hidden
        }

        .weui-navigator-list li a {
            text-decoration: none;
            color: #666;
            display: block;
            width: 100%;
            -webkit-box-sizing: border-box;
            padding: 0 15px
        }

        .weui-navigator-list li.weui-process-hover, .weui-navigator-list li.weui-process-active a {
            color: #04be02;
        }

        .weui-navigator-list li.weui-process-hover, .weui-navigator-list li.weui-process-active a:after {
            content: '';
            display: block;
            height: 2px;
            background-color: #04be02
        }

        .weui-navigator .weui-navigator-list {
            display: table;
            table-layout: fixed;
            white-space: nowrap;
            width: auto
        }

        .weui-navigator .weui-navigator-list:after {
            content: '';
            clear: both;
            display: inline-block;
            width: 0;
            height: 0;
            overflow: hidden
        }

        .weui-navigator .weui-navigator-list li {
            display: inline-block
        }

        .weui-navigator:after {
            border-bottom: 0px solid #d9d9d9;
        }

        .weui-navigator .weui-navigator-list li span {
            background-color: #ffa726;
            color: #fff;
            display: block;
            padding: 0 28px;
        }

        .weui_navbar_item {
            border-bottom: 1px solid #d9d9d9;
            background-color: #fefefe;
        }

        .weui_navbar_item.weui_bar_item_on, .weui-process-active {
            background-color: #fff8e1;
            border-bottom: 1px solid #e1f5fe;
        }

        .weui_grids {
            text-align: center;
        }

        .weui_grids:before {
            border: 0px solid #d9d9d9;
        }

        .weui_grid {
            position: relative;
            float: left;
            padding: 10px 5px;
            width: 32%;
            box-sizing: border-box;
            border: 1px solid #d9d9d9;
            margin: 0 0 1% 1%;
        }

        .weui_grid:before {
            border-bottom: 0px solid #d9d9d9;
            border-right: 0px solid #d9d9d9;
        }

        .pop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            height: 100%;
            width: 100%;
            animation: poupFadIn 0.5s ease 0s 1;
            outline: none
        }

        .pop .box {
            border-radius: 10px;
            background-color: #fff;
            position: fixed;
            z-index: 1001;
            left: 20px;
            right: 20px;
            top: 100px;
            max-height: 360px;
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.32), 0 -3px 0px 0px rgba(0, 0, 0, 0.15) inset;
            -webkit-animation: f1 0.5s 0s ease 1;
            overflow: auto;
        }

        @-webkit-keyframes f1 {
            0% {
                -webkit-transform: translateY(50px);
                opacity: 0;
            }
            100% {
                -webkit-transform: translateY(0);
                opacity: 1;
            }
        }

        .pop .box .closeb {
            cursor: pointer;
            position: absolute;
            display: block;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            text-indent: -9999px;
            top: 5px;
            right: 5px;
        }

        .pop .box .closeb:after {
            position: absolute;
            content: '.';
            display: block;
            width: 20px;
            height: 1px;
            background: #B9B9B9;
            -webkit-transform: rotate(45deg);
            top: 14px;
            left: 5px;
        }

        .pop .box .closeb:before {
            position: absolute;
            content: '.';
            display: block;
            width: 20px;
            height: 1px;
            background: #B9B9B9;
            -webkit-transform: rotate(-45deg);
            top: 14px;
            left: 5px;
        }

        .pop .box h1 {
            color: #333;
            text-align: center;
            padding: 10px 0;
            font-size: 16px;
        }

        .pop .box h2 {
            color: #ee635f;
            font-size: 12px;
            text-align: center;
            padding: 0 5px 5px 5px;
            word-wrap: break-word;
        }

        .pop .box .inputqy {
            margin: 15px 15px;
            overflow: hidden;
        }

        .pop .box .inputqy input {
            box-sizing: border-box;
            padding: 10px;
            background-color: #FCFCFC;
            color: #666;
            border-radius: 40px;
            width: 100%;
            margin: 5px auto;
            font-size: 14px;
            border: 1px #E9E9E9 solid;
        }

        .pop .box .inputqy select {
            box-sizing: border-box;
            padding: 10px;
            background-color: #FCFCFC;
            color: #666;
            border-radius: 40px;
            width: 100%;
            margin: 5px auto;
            font-size: 14px;
            border: 1px #E9E9E9 solid;
        }

        .pop .box .but_con {
            bottom: 0;
            margin: 10px 15px 20px 15px;
            overflow: hidden;
        }

        .pop .box .w49 {
            width: 49%;
        }

        .pop .button_yes {
            width: 100%;
            text-align: center;
            display: inline-block;
            box-sizing: border-box;
            font-size: 16px;
            font-weight: bold;
            color: #fff;
            border-radius: 40px;
            padding: 0;
            cursor: pointer;
        }

        .pop .button_yes:active {
            border: 1px solid #DA443F;
            background-color: #04be02;
        }

        .pop .button_no {
            width: 100%;
            text-align: center;
            display: inline-block;
            box-sizing: border-box;
            font-size: 16px;
            color: #999;
            border-radius: 40px;
            padding: 10px 0;
            border: 1px solid #ccc;
            background-color: transparent;
            cursor: pointer;
        }

        .pop .button_no:active {
            background-image: linear-gradient(to top, #dedede, #f2f2f2);
        }
    </style>


    <div class="weui_tab_bd" style="padding-bottom:75px;">
        <div class="m-box">
            <div class="m-img"><img src="/static/copy/picture/atxx1bundbvtx1vbdvtbbtb2zvcbbb.jpg"></div>

            <a href="/yuyue/list"
               style="position: fixed;top:10px;right:5%;z-index:9;" class="f-white f14">
                <svg class="icon f-teal" aria-hidden="true">
                    <use xlink:href="#icon-time"></use>
                </svg>
                我的预约 </a>
        </div>

        <form action="#"
              class=""
              enctype="multipart/form-data" method="POST" id="form">
            <input type="hidden" name="repeat" value="febcffafbe357c08d3447f7f2e76f650">
            <div class="weui_cells weui_cells_form" style="margin:0;">
                <div class="weui_cell">
                    <div class="weui_cell_hd">
                        <svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-member"></use>
                        </svg>
                    </div>
                    <div class="weui_cell_bd weui_cell_primary">
                        <input class="weui_input" type="text" name="member" id="member" value="" placeholder="请输入您的姓名"/>
                    </div>
                </div>
                <div class="weui_cell">
                    <div class="weui_cell_hd">
                        <svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-phone"></use>
                        </svg>
                    </div>
                    <div class="weui_cell_bd weui_cell_primary">
                        <input class="weui_input" type="number" name="mobile" id="mobile" value="" required
                               pattern="[0-9]{11}" maxlength="11" placeholder="请输入手机号码" emptyTips="请输入手机号"
                               notMatchTips="请输入正确的手机号">
                    </div>
                </div>
            </div>
            <div class="weui_panel weui_cells_access">
                <div class="weui_cell" href="test.com">
                    <div class="weui_cell_hd"><label class="weui_label weui-start">预约时间</label></div>
                    <div class="weui_cell_bd weui_cell_primary open-popup" onclick="fetchgetjs(this,2)"
                         data-target="#popup">
                        <!--		<input class="weui_input f-black open-popup"
                        name="restime" id="restime" type="text" value="" onclick="bookings(this)"
                        data-target="#popup" readonly>-->
                        <span class="" id="choosetimes">请选择预约时间</span>
                        <input class="weui_input" name="restime" id="restime" type="hidden" value="">
                        <input class="weui_input" type="hidden" name="ii" id="ii" value="" readonly>
                        <input class="weui_input" type="hidden" name="userId" id="userId"
                               th:value=" ${session.user ne null ?session.user.id :''}">
                    </div>
                    <div class="weui_cell_ft f-green time"></div>
                </div>
                <script id="datelist" type="text/html">
                    <div id="tagnav" class="weui-navigator weui-navigator-wrapper weui_navbar"
                         style="background-color:#f5f5f5;">
                        <ul class="weui-navigator-list" style="margin:0;">
                            <% for(var i in list) { %>
                            <li class="weui_navbar_item">
                                <span class=""><%=list[i].weekarray%></span>
                                <%=list[i].date%>
                            </li>
                            <% } %>
                        </ul>
                    </div>
                    <div id="tagnavcontent" class="weui_tab_bds">
                    </div>
                </script>
                <script id="timelist" type="text/html">
                    <% for(var i in time) { %>
                    <div class="weui_tab_bd_item">
                        <div class="page-bd" style="margin-top:10px;">
                            <ul>
                                <% for(var ii in time[i]) { %>
                                <%=time[i][ii].time%>
                                <% } %>
                            </ul>
                        </div>
                    </div>
                    <% } %>
                </script>
                <div class="weui_cell">
                    <div class="weui_cell_hd">
                        <label class="weui_label weui-start">服务项目</label>
                    </div>
                    <div class="weui_cell_bd weui_cell_primary open-popup" onclick="fetchgetjs(this,1)"
                         data-target="#popup">
                        <input class="weui_input" type="hidden" name="xmid" id="xmid" value="" placeholder="请选择服务项目"
                               readonly>
                        <span class="" id="item">请选择服务项目</span>
                    </div>
                    <div class="weui_cell_ft price f-orange"></div>
                </div>
                <input class="weui_input" type="hidden" name="itemprice" id="itemprice" value="">
                <script id="iteminfo" type="text/html">
                    <div class="weui_panel weui_panel_access">
                        <div class="weui_panel_bd">
                            <% for(var i in list) { %>
                            <div class="weui_media_box weui_media_appmsg <%=list[i].checked%>" data="<%=list[i].title%>"
                                 onclick="chooseitem(this,'<%=list[i].id%>','<%=list[i].price%>')">
                                <div class="weui_media_hd">
                                    <span class="weui_media_appmsg_thumb"><img class="weui_media_appmsg_thumb"
                                                                               src="<%=list[i].thumb%>"></span>
                                </div>
                                <div class="weui_media_bd dayu">
                                    <h4 class="weui_media_title"><span><%=list[i].title%></span><%=list[i].isc%></h4>
                                    <p class="weui_media_desc">
                                        <%=list[i].money%>
                                    </p>
                                </div>
                            </div>
                            <div id="i<%=list[i].id%>" class="pop" style="display:none;">
                                <div class="box">
                                    <div class="inputqy">
                                        <div class="jptext"><%=list[i].content%></div>
                                    </div>
                                </div>
                                <div style="position:absolute;top:60px;right:1em;"><span class="button_yes"
                                                                                         onClick="document.getElementById('i<%=list[i].id%>').style.display='none';"><svg
                                        class="icon f35" aria-hidden="true"><use
                                        xlink:href="#icon-close"></use></svg></span></div>
                            </div>
                            <% } %>
                        </div>
                    </div>
                </script>
                <input class="weui_input" name="paytype" type="hidden" value="1">
            </div>
            <div class="weui_panel weui_cells_form">


                <div class="weui_cell">
                    <div class="weui_cell_hd"><label for="name" class="weui_label weui-start">车辆类型</label></div>
                    <div class="weui_cell_bd weui_cell_primary">
                        <input type="text" class="weui_input" id="9" name="field_9_" placeholder="请选择车辆类型" value="">
                    </div>
                    <div class="weui_cell_ft"></div>
                </div>
                <script>
                    $("#9").select({
                        title: "车辆类型",
                        items: [
                            "普通车辆",
                            "新能源车辆"
                        ],
                        onChange: function (d) {
                            console.log(this, d);
                        }
                    });
                </script>


            </div>

            <div class="weui-footer weui-footer-fixed-bottom weui-border-t"
                 style="padding:10px;bottom:0px;background-color:#fff;">
                <div class="weui-flex">
                    <div class="weui-flex-item">
                        <div class="placeholder f25 f-orange">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-renminbi"></use>
                            </svg>
                            <font id="money"></font>
                        </div>
                    </div>
                    <div class="weui-flex-item">
                        <input type="hidden" name="token" value="Mt82"/>
                        <input class="weui_btn bg-blue f-white" type="button" value="立 即 提 交" id="showTool">
                    </div>
                </div>
            </div>
        </form>

    </div>
    <div id="popup" class="weui-popup-container">
        <div class="weui-popup-modal">
            <div id="dayu">
                <div class="bg-blue weui-header picker" style="margin-bottom:10px;">
                    <div class="weui-header-left close-popup">
                        <svg class="icon f-white center" aria-hidden="true">
                            <use xlink:href="#icon-down"></use>
                        </svg>
                    </div>
                    <h1 class="weui-header-title"></h1>
                    <div class="weui-header-right"></div>
                </div>
                <div class="content">
                </div>
                <div class="footer"></div>
            </div>
            <div id="content">
                <div class="weui-header bg-blue">
                    <div class="weui-header-left">
                        <a href="javascript:;" class="icon f-white close-popup">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-down"></use>
                            </svg>
                        </a>
                    </div>
                    <h1 class="weui-header-title">检车预约</h1>
                </div>
                <div class="weui_tab_bd">
                    <div class="weui-weixin">
                        <div class="weui-weixin-ui">
                            <div class="weui-weixin-page">
                                <div class="weui-weixin-img">
                                    <img src="/static/copy/picture/atxx1bundbvtx1vbdvtbbtb2zvcbbb.jpg">
                                </div>
                                <div class="weui-weixin-content">
                                </div>
                                <p class="p"><a href="javascript:;" class="weui_btn bg-blue close-popup">关闭</a></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function upimg(obj, id) {
            var images = {
                localId: [],
                serverId: []
            };
            wx.chooseImage({
                count: 1,
                sizeType: ['original', 'compressed'],
                sourceType: ['album', 'camera'],
                success: function (res) {
                    images.localId = res.localIds;
                    var i = 0, length = images.localId.length;
                    var wxUpload = function () {
                        wx.uploadImage({
                            localId: images.localId[i],
                            isShowProgressTips: 1,
                            success: function (res) {
                                i++;
                                images.serverId.push(res.serverId);
                                var url = "./index.php?i=17&c=entry&type=image&do=uploads&m=dayu_yuyuepay&serverId=" + res.serverId + "&localId=" + i;
                                $.post(url, function (dat) {
                                    var dat = eval("(" + dat + ")");
                                    if (dat.status == 'success') {
                                        $.toast(dat.message, "success");
                                        $('input[name="' + obj.getAttribute("data") + '"]').val(tomedia(dat.path));
                                        document.getElementById('show' + id).src = tomedia(dat.path);
                                    } else {
                                        $.toast(dat.message, "cancel");
                                        document.getElementById('show' + id).src = "";
                                    }
                                });
                                if (i < length) {
                                    wxUpload();
                                }
                            },
                            fail: function (res) {
                                alert(JSON.stringify(res));
                            }
                        });
                    };
                    wxUpload();
                }
            });
        }

        function show(obj, id) {
            var pic = document.getElementById(id).src;
            wx.previewImage({
                current: pic,
                urls: [pic]

            });
        }
    </script>
    <script type="text/javascript">
        function changeAddress() {
            location.href = './index.php?i=17&c=entry&from=dayu_yuyuepay&reid=1&sid=&returnurl=http%253A%252F%252F888.huipin.co%252Fapp%252Findex.php%253Fi%253D17%2526c%253Dentry%2526id%253D1%2526do%253Ddayu_yuyuepay%2526m%253Ddayu_yuyuepay&do=address&m=dayu_yuyuepay'
        }

        function changeInfo() {
            location.href = './index.php?i=17&c=entry&from=dayu_yuyuepay&reid=1&sid=&returnurl=http%253A%252F%252F888.huipin.co%252Fapp%252Findex.php%253Fi%253D17%2526c%253Dentry%2526id%253D1%2526do%253Ddayu_yuyuepay%2526m%253Ddayu_yuyuepay&do=profile&m=dayu_yuyuepay'
        }

        $(function () {
            count_price();
        });

        var url = "./index.php?i=17&c=entry&do=getprice&m=dayu_yuyuepay";

        function check_id(value) {
            var arrExp = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];//加权因子
            var arrValid = [1, 0, "X", 9, 8, 7, 6, 5, 4, 3, 2];//校验码
            if (/^\d{17}\d|x$/i.test(value)) {
                var sum = 0, idx;
                for (var i = 0; i < value.length - 1; i++) {
                    // 对前17位数字与权值乘积求和
                    sum += parseInt(value.substr(i, 1), 10) * arrExp[i];
                }
                // 计算模（固定算法）
                idx = sum % 11;
                // 检验第18为是否与校验码相等
                return arrValid[idx] == value.substr(17, 1).toUpperCase();
            } else {
                return false;
            }
        }

        $(".weui_panel_bd div").click(function () {
            $(this).toggleClass("actvd");
        });

        function cleanhtml() {
            $('#dayu').fadeIn();
            $('#content').hide();
            $('.content').html('');
            $('.picker .weui-header-right').html('');
            $('.footer').html('');
        }

        //预约时间 类型 1item 2time
        function fetchgetjs(obj, type) {
            cleanhtml();
            var result = '';
            var result2 = '';
            var optioned; //选择勾选服务
            switch (type) {
                case '0':
                    $('#content').fadeIn();
                    $('#dayu').fadeOut();
                    break;
                case 1:
                    var result = '';
                    var result2 = '';
                    var xmid = $("#xmid").val();
                    var postData = {
                        'xmid': xmid
                    };
                    optioned=parseInt(xmid);
                    $.get("/static/copy/json/getcar.json", postData, function (data) {
                        if(optioned>0){
                            for(var o=0;o<data.list.length;o++){
                                data.list[o].checked="";
                            }
                            data.list[optioned-1].checked="actvd";
                        }
                        var tplx = document.getElementById('iteminfo').innerHTML;
                        var arrLen = data.list.length;
                        if (arrLen > 0) {
                            var result = tpl(tplx, data);
                        } else {
                            result = '<div class="weui_msg"><div class="weui_msg_box"><p>无</p></div></div>';
                        }
                        result2 = '<div class="weui_btn_area"><a href="javascript:" class="weui_btn bg-blue" onclick="reselect(this,1)">确定</a></div>';
                        $('.content').html(result);
                        $('.footer').html(result2);
                        $('.picker .weui-header-title').html(data.title);
                        $('.picker .weui-header-right').html(data.right);
                    }, "json");
                    break;
                case 2:
                    var result = '';
                    var result2 = '';
                    var result3 = '';
                    var restime = $("#restime").val();
                    $.get("/yuyue/getYuyueConf", {
                        'restime': restime
                    }, function (data) {
                        var tplx = document.getElementById('datelist').innerHTML;
                        var tplt = document.getElementById('timelist').innerHTML;
                        var arrLen = data.list.length;
                        if (arrLen > 0) {
                            var result = tpl(tplx, data);
                            var result2 = tpl(tplt, data);
                        }
                        result3 = '<div class="weui_btn_area"><a href="javascript:" class="weui_btn bg-blue" onclick="reselect(this,2)">确定</a></div>';
                        $('.content').html(result);
                        $('#tagnavcontent').html(result2);
                        $('.footer').html(result3);
                        //		console.log(result2);
                        TagNav('#tagnav', {
                            type: 'scrollToFirst',
                        });
                        $('.weui_tab').tab({
                            defaultIndex: 0,
                            activeClass: 'weui_bar_item_osn',
                            onToggle: function (index) {
                                if (index > 0) {
                                    //				alert(index)
                                }
                            }
                        });
                        $('.picker .weui-header-title').html(data.title);
                    }, "json");
                    break;
            }
        }

        function itemshow(obj, id) {
            $('#i' + id).show();
        }

        function chooseitem(obj, id, price) {
            $("#xmid").val(id);
//	$(".price").html('<svg class="icon" aria-hidden="true"><use xlink:href="#icon-yuan"></use></svg>'+price);
            if (price == '0.00') {
                $("#money").html('<small>免费预约</small>');
            } else {
                $("#money").html(price);
                $("#itemprice").val(price);
            }
            $(".weui_media_box").removeClass("actvd");
            $(obj).toggleClass("actvd");
//	count_price();
        }

        function count_price() {
            var cho_money = $('#itemprice').val();
            var sel_length = $('#num').val();
            if (empty(sel_length)) {
                sel_length = '1';
            } else {
                sel_length = sel_length;
            }
            $('#money').text((Number(cho_money) * Number(sel_length)).toFixed(2));
        }

        function reselect(obj, type, id) {
            switch (type) {
                case 1:
                    var xmid = $("#xmid").val();
                    var c = $(".weui_media_box.actvd .weui_media_title span").text();
                    var item = (!empty(c)) ? c : '';
                    if (empty(xmid)) {
                        $.toast("请选择服务项目", "cancel");
                        return false;
                    }
                    $("#item").text(item);
                    //		$('.content').fadeOut();
                    //		$(this).parent().remove();
                    count_price();
                    $.closePopup();
                    break;
                case 2:
                    var restime = $("#restime").val();
                    if (restime == '') {
                        $.toast('请选择', "cancel");
                        return false;
                    } else {
                        var choosetimes = $("#choosetimes").text();
                        var ii = $("#ii").val();
                       /* $.post("./index.php?i=17&c=entry&type=all&reid=1&do=CheckTime&m=dayu_yuyuepay", {
                            'ii': ii,
                            'restime': choosetimes
                        }, function (s) {
                            if (s.message.status == '0') {
                                $.alert(s.message.msg, s.message.title);
                                $("#ii").val('');
                                $("#choosetimes").text('');
                                $("#restime").val('');
                                return;
                            } else {*/
                                $(".time").html('重选');
                                $("#restime").val(choosetimes);
                            }
                    /* }, "json");*/
                        $.closePopup();
//                    }
                    break;
            }
        }

        function choosetime(obj, ii) {
            $("#ii").val(ii);
            $("#choosetimes").text(obj.getAttribute("data"));
            $("#restime").val(obj.getAttribute("data"));
            $(".ctime").removeClass("actvd");
            $(obj).toggleClass("actvd");
        }

        $("#showTool").on("click", function () {
            var rand = Math.floor(Math.random() * 1000) + 1000;
//            $.showLoading('正在提交...');
            var member = $('#member').val(),
                mobile = $("#mobile").val(),
                restime = $("#restime").val(),
                xmid = $('#xmid').val(),
                ii = $("#ii").val(),
                num = $("#num").val(),
                price = $("#itemprice").val(),
                userId = $("#userId").val(),
                process = '1';

            if (member == '' || is_chinese(member) == false) {
                $.hideLoading();
                $.toast("请正确输入姓名", "forbidden");
                return false;
            }
            if (mobile == '' || is_phone(mobile) == false) {
                $.hideLoading();
                $.toast("请输入正确的手机号码", "forbidden");
                return false;
            }
            if (restime == '') {
                $.hideLoading();
                $.toast('请选择预约时间', "forbidden");
                return false;
            }
            if (xmid == '') {
                $.hideLoading();
                $.toast('请选择服务项目', "forbidden");
                return false;
            }

            if ($('input[name="field_9_"]').val() == '') {
                $.hideLoading();
                $.toast("车辆类型 不能为空", 'forbidden');
                return false;
            }
            //	setTimeout(function() {
           /* $.post("./index.php?i=17&c=entry&type=all&reid=1&do=CheckTime&m=dayu_yuyuepay", {
                'ii': ii,
                'restime': restime,
                'num': num
            }, function (d) {
                if (d.message.status == '0') {
                    $.hideLoading();
                    $.alert(d.message.msg, d.message.title);
                    return false;
                } else if (d.message.status == '1') {*/
                    //		alert($('textarea[name="field_1434_"]').val());

                    var submitData = {
                        'realname': member,
                        'mobile': mobile,
                        'serverItem': xmid,
//                        'price': price,
                        'restime': restime,
                        'ii': ii,
                        "userId":userId,
                        "carType": $('input[name="field_9_"]').val()
                    };

                    $.post("/yuyue/saveYuyue", submitData, function (s) {
                        console.log(s);
                        if (s.status == 200) {
                            $.hideLoading();
                            $.toast(s.msg);
                            setTimeout(function () {
                                window.location.href = s.data;
                            }, 1000)
                        } else {
                            $.hideLoading();
                            $.toast(s.msg, "forbidden");
                        }
                    }, "json");
            /* }
         }, "json");*/

//	}, rand)
        });
    </script>
</div>
<script type="text/javascript">
    $(function () {
        wx.config(jssdkconfig);
        wx.showOptionMenu();
        var $_share = {
            "title": "\u68c0\u8f66\u9884\u7ea6",
            "imgUrl": "http:\/\/888.huipin.co\/attachment\/images\/17\/2020\/05\/AtxX1BuNDbVtX1VBdVtBBTb2ZvCBBB.jpg",
            "desc": "",
            "link": "http:\/\/888.huipin.co\/app\/index.php?i=17&c=entry&id=1&do=dayu_yuyuepay&m=dayu_yuyuepay"
        };
        if (typeof sharedata == 'undefined') {
            sharedata = $_share;
        } else {
            sharedata['title'] = sharedata['title'] || $_share['title'];
            sharedata['desc'] = sharedata['desc'] || $_share['desc'];
            sharedata['link'] = sharedata['link'] || $_share['link'];
            sharedata['imgUrl'] = sharedata['imgUrl'] || $_share['imgUrl'];
        }

        if (sharedata.imgUrl == '') {
            var _share_img = $('body img:eq(0)').attr("src");
            if (_share_img == "") {
                sharedata['imgUrl'] = window.sysinfo.attachurl + 'images/global/wechat_share.png';
            } else {
                sharedata['imgUrl'] = tomedia(_share_img);
            }
        }
        wx.ready(function () {
            wx.onMenuShareAppMessage(sharedata);
            wx.onMenuShareTimeline(sharedata);
            wx.onMenuShareQQ(sharedata);
            wx.onMenuShareWeibo(sharedata);
        });

    });

    function tomedia(src) {
        if (typeof src != 'string')
            return '';
        if (src.indexOf('http://') == 0 || src.indexOf('https://') == 0) {
            return src;
        } else if (src.indexOf('../addons') == 0 || src.indexOf('../attachment') == 0) {
            src = src.substr(3);
            return window.sysinfo.siteroot + src;
        } else if (src.indexOf('./resource') == 0) {
            src = src.substr(2);
            return window.sysinfo.siteroot + 'app/' + src;
        } else if (src.indexOf('images/') == 0) {
            return window.sysinfo.attachurl + src;
        }
    }
</script>
</body>
</html>
